<?php
namespace Home\Controller;
use Common\Controller\CommonController;
class NewsController extends CommonController {
    public function index(){
    	$count=M("Article")->where(array('status'=>1))->count();
    	$Page = new \Think\Page($count,5);
    	$show = $Page->show();
    	$list=M('Article')->where('status = 1')->order("add_time desc")->limit($Page->firstRow.','.$Page->listRows)->select();
    	$this->assign('list',$list);
    	$this->assign('page',$show);
    	$this->display();
    }
    public function details(){
    	$where['id']=I('id');
    	$where['status']=1;
		$list=M('Article')->where($where)->find();
		$this->assign('list',$list);
		$this->display(); 
    }
}